home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 21
/
AACD 21.iso
/
AACD
/
Programming
/
amigatalk
/
intuition
/
GadgetTypes.st
< prev
next >
Wrap
Text File
|
2001-02-28
|
3KB
|
69 lines
" ------------------------------------------------------------------- "
" GadgetTypes Class is a Singleton class that allows the user to "
" reference Gadget Types without having to remember their actual "
" hexadecimal values. "
" ------------------------------------------------------------------- "
Class GadgetTypes :Dictionary ! uniqueInstance !
[
privateNew ! newinstance !
newinstance <- super new.
^ newinstance
|
new
^ (self privateSetup)
|
privateSetup
(uniqueInstance isNil)
ifTrue: [uniqueInstance <- self privateNew.
self at: #GTYP_GTYPEMASK put: 2r0111. "For masking."
self at: #GTYP_BOOLGADGET put: 1.
self at: #GTYP_GADGET0002 put: 2.
self at: #GTYP_PROPGADGET put: 3.
self at: #GTYP_STRGADGET put: 4.
self at: #GTYP_CUSTOMGADGET put: 5.
self at: #GTYP_SYSTYPEMASK put: 16r00F0. "For masking."
self at: #GTYP_SIZING put: 16r0010.
self at: #GTYP_WDRAGGING put: 16r0020.
self at: #GTYP_SDRAGGING put: 16r0030.
self at: #GTYP_WDEPTH put: 16r0040.
self at: #GTYP_SDEPTH put: 16r0050.
self at: #GTYP_WZOOM put: 16r0060.
self at: #GTYP_SUNUSED put: 16r0070.
self at: #GTYP_CLOSE put: 16r0080.
"All Gadget Global Type flags (padded): "
self at: #GTYP_GADGETTYPE put: 16rFC00.
self at: #GTYP_REQGADGET put: 16r1000.
self at: #GTYP_GZZGADGET put: 16r2000.
self at: #GTYP_SCRGADGET put: 16r4000.
self at: #GTYP_SYSGADGET put: 16r8000.
"GadTools uses a lot of different types:"
self at: #GENERIC_KIND put: 0.
self at: #BUTTON_KIND put: 1.
self at: #CHECKBOX_KIND put: 2.
self at: #INTEGER_KIND put: 3.
self at: #LISTVIEW_KIND put: 4.
self at: #MX_KIND put: 5.
self at: #NUMBER_KIND put: 6.
self at: #CYCLE_KIND put: 7.
self at: #PALETTE_KIND put: 8.
self at: #SCROLLER_KIND put: 9.
"Kind number 10 is reserved."
self at: #SLIDER_KIND put: 11.
self at: #STRING_KIND put: 12.
self at: #TEXT_KIND put: 13.
].
^ self "uniqueInstance??"
]